#pragma once

#ifndef XTK_H
#define XTK_H


//==============================================================================
//== CONSTANT 
//==============================================================================
#define XTK_VER							"v2.3"
#define XCF_VER							"v1.4"
#define MAX_EXP							8
#define SUCCESS							0
#define FAILURE							1
#define NULL_XTK_STRUCT					-1
#define XTK_MAX_STRLEN					1024
#define DELIMITERS						"= {} [] ,; \t\n"
#define XCF_COMMENT						"#"


//==============================================================================
//== XTK API 
//==============================================================================
#include "XtkDev_struct.h"

extern "C" {
			
__declspec(dllexport) XtkDev* xtk_init(char* xcf_file_name); 

__declspec(dllexport) char xtk_config(XtkDev* xtk_p);

__declspec(dllexport) char xtk_start(XtkDev* xtk_p);

__declspec(dllexport) char xtk_get_line(XtkDev* xtk_p,unsigned short* PixelsData);

__declspec(dllexport) char xtk_get_line_timestamp(XtkDev* xtk_p, unsigned short* PixelsData, unsigned short* ln_cnt);

__declspec(dllexport) char xtk_stop(XtkDev* xtk_p);

__declspec(dllexport) char xtk_close(XtkDev* xtk_p);

__declspec(dllexport) char xtk_set_intf_path(XtkDev* xtk_p, char* intf_path);

__declspec(dllexport) char xtk_set_single_reg(XtkDev* xtk_p, unsigned char Address, unsigned char Reg, unsigned char Value);

__declspec(dllexport) char xtk_set_rst_time(XtkDev* xtk_p, unsigned char mantissa, unsigned char exponent);

__declspec(dllexport) char xtk_set_int_time(XtkDev* xtk_p, unsigned char mantissa, unsigned char exponent);

__declspec(dllexport) char xtk_set_Tint(XtkDev* xtk_p, float Tint);

__declspec(dllexport) char xtk_set_pixel_clk(XtkDev* xtk_p, float value);

__declspec(dllexport) char xtk_set_posenc(XtkDev* xtk_p, unsigned char value);

__declspec(dllexport) char xtk_set_resolution(XtkDev* xtk_p, unsigned char res);

__declspec(dllexport) char xtk_set_sensitivity(XtkDev* xtk_p, unsigned char sns);

__declspec(dllexport) char xtk_set_gain(XtkDev* xtk_p, unsigned char gns);

__declspec(dllexport) float xtk_get_rst_time(XtkDev* xtk_p);

__declspec(dllexport) float xtk_get_int_time(XtkDev* xtk_p);

__declspec(dllexport) float xtk_get_rden_delay(XtkDev* xtk_p);

__declspec(dllexport) float xtk_get_rden_pulse(XtkDev* xtk_p);

__declspec(dllexport) float xtk_get_pixel_clk(XtkDev* xtk_p);

__declspec(dllexport) int xtk_get_posenc(XtkDev* xtk_p);

__declspec(dllexport) char xtk_get_resolution(XtkDev* xtk_p);

__declspec(dllexport) float xtk_get_resolution_value(XtkDev* xtk_p);

__declspec(dllexport) char xtk_get_sensitivity(XtkDev* xtk_p);

__declspec(dllexport) char xtk_get_gain(XtkDev* xtk_p);

__declspec(dllexport) long xtk_get_pixels_per_array(XtkDev* xtk_p);

__declspec(dllexport) long xtk_get_pixels_per_module(XtkDev* xtk_p);

__declspec(dllexport) long xtk_get_modules_per_array(XtkDev* xtk_p);

__declspec(dllexport) long xtk_get_adc_gain(XtkDev* xtk_p);

__declspec(dllexport) long xtk_get_adc_offset(XtkDev* xtk_p);

__declspec(dllexport) char* xtk_get_info(XtkDev* xtk_p);

__declspec(dllexport) char xtk_save_config_file(XtkDev* xtk_p, char* xcf_file_name);

__declspec(dllexport) int xtk_flush_buffer(XtkDev* xtk_p);

__declspec(dllexport) void xtk_man_exp_ized(unsigned long number, unsigned char *man, unsigned char *exp);

}


#endif